package generator.util;

import generator.entity.ClassInfo;

import java.util.ArrayList;
import java.util.List;

/**
 * 生成配置
 *
 * @author chengsp
 * @date 2019/9/20 15:56
 */
public class GenConfig {
    /**
     * 作者
     */
    private String authorName;
    /**
     * 根包名
     */
    private String packageName;
    /**
     * 控制层返回实体名称
     */
    private String resultName;
    /**
     * 工程路径
     */
    private String rootPath;
    /**
     * 工程名称
     */
    private String projectName;
    /**
     * 数据库相关配置
     */
    private String driverName;
    private String user;
    private String password;
    private String url;
    private String dbType;
    /**
     * 数据库名
     */
    private String dbName;
    /**
     * 需要处理的表名
     */
    private String[] tableNames;
    /**
     * 是否覆盖已存在的文件
     */
    private boolean override = false;
    /**
     * 是否启用redis
     */
    private boolean enableRedis = false;
    /**
     * 是否启用ES
     */
    private boolean enableES = false;
    /**
     * 所有的类信息
     */
    private List<ClassInfo> classInfoList;
    /**
     * 持久层实现方式
     */
    private RepositoryType repositoryType;

    public String getAuthorName() {
        return authorName;
    }

    public void setAuthorName(String authorName) {
        this.authorName = authorName;
    }

    public String getPackageName() {
        return packageName;
    }

    public void setPackageName(String packageName) {
        this.packageName = packageName;
    }

    public String getResultName() {
        return resultName;
    }

    public void setResultName(String resultName) {
        this.resultName = resultName;
    }

    public RepositoryType getRepositoryType() {
        return repositoryType;
    }

    public void setRepositoryType(RepositoryType repositoryType) {
        this.repositoryType = repositoryType;
    }

    public String getRootPath() {
        return rootPath;
    }

    public void setRootPath(String rootPath) {
        this.rootPath = rootPath;
    }

    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    public String getDriverName() {
        return driverName;
    }

    public void setDriverName(String driverName) {
        this.driverName = driverName;
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getDbType() {
        return dbType;
    }

    public void setDbType(String dbType) {
        this.dbType = dbType;
    }

    public boolean isOverride() {
        return override;
    }

    public void setOverride(boolean override) {
        this.override = override;
    }

    public boolean isEnableRedis() {
        return enableRedis;
    }

    public void setEnableRedis(boolean enableRedis) {
        this.enableRedis = enableRedis;
    }

    public boolean isEnableES() {
        return enableES;
    }

    public void setEnableES(boolean enableES) {
        this.enableES = enableES;
    }

    public String getDbName() {
        return dbName;
    }

    public void setDbName(String dbName) {
        this.dbName = dbName;
    }

    public String[] getTableNames() {
        return tableNames;
    }

    public void setTableNames(String[] tableNames) {
        this.tableNames = tableNames;
    }

    public List<ClassInfo> getClassInfoList() {
        if (classInfoList == null) {
            return new ArrayList<>();
        }
        return classInfoList;
    }

    public void setClassInfoList(List<ClassInfo> classInfoList) {
        this.classInfoList = classInfoList;
    }
}
